package org.cristiangm.dados;

import java.util.Random;
import java.util.Vector;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;


public class resultados extends ListActivity{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
    	
    	int numDados = Integer.parseInt(getIntent().getStringExtra("com.cristiangm.dados.Dados.stringNumDados"));
    	int numTiradas = Integer.parseInt(getIntent().getStringExtra("com.cristiangm.dados.Dados.stringTiradas"));

    	Random generator = new Random();
    	Vector<String> mStrings = new Vector<String>();
    	boolean first;
    	for (int i = 0; i < numTiradas; i++){
    		String res = "";
        	first = true;
    		for (int j = 0; j < numDados; j++){
        		if (first){
        			first = false;
        		} else { 
        			res = res + ", ";
        		}
    			int k = generator.nextInt(6) + 1;
    			res = res + Integer.toString(k);
    		}
    		mStrings.add(res);
    	}
    	
    	
    	this.setListAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mStrings));
    }


} 